project(vslam_examples)
cmake_minimum_required(VERSION 3.10)

## function: dai_add_example(example_name example_src enable_test use_pcl)
## function: dai_set_example_test_labels(example_name ...)

if(DEPTHAI_RTABMAP_SUPPORT)
    find_package(rerun_sdk CONFIG REQUIRED)
    dai_add_example(rtabmap_vio rtabmap_vio.cpp OFF OFF)
    if(DEPTHAI_MERGED_TARGET)
        target_link_libraries(rtabmap_vio PRIVATE depthai::core rerun_sdk)
    else()
        target_link_libraries(rtabmap_vio PRIVATE depthai::rtabmap rerun_sdk)
    endif()

    dai_add_example(rtabmap_vio_slam rtabmap_vio_slam.cpp OFF ON)
    if(DEPTHAI_MERGED_TARGET)
        target_link_libraries(rtabmap_vio_slam PRIVATE depthai::core rerun_sdk)
    else()
        target_link_libraries(rtabmap_vio_slam PRIVATE depthai::rtabmap rerun_sdk)
    endif()

    if(DEPTHAI_BASALT_SUPPORT)
        dai_add_example(basalt_vio_rtabmap_slam basalt_vio_rtabmap_slam.cpp OFF ON)
        if(DEPTHAI_MERGED_TARGET)
            target_link_libraries(basalt_vio_rtabmap_slam PRIVATE depthai::core rerun_sdk)
        else()
            target_link_libraries(basalt_vio_rtabmap_slam PRIVATE depthai::basalt depthai::rtabmap rerun_sdk)
        endif()
    endif()

endif()

if(DEPTHAI_BASALT_SUPPORT)
    find_package(rerun_sdk CONFIG REQUIRED)

    dai_add_example(basalt_vio basalt_vio.cpp OFF OFF)
    if(DEPTHAI_MERGED_TARGET)
        target_link_libraries(basalt_vio PRIVATE depthai::core rerun_sdk)
    else()
        target_link_libraries(basalt_vio PRIVATE depthai::basalt rerun_sdk)
    endif()
endif()